﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicData.ErrorCode
{
    public class APIResult<T>
    {
        public string Message {  get; set; }
        public APIEnum Code { get; set; }
        public T Data { get; set; }
        public static APIResult<T> Success(string message, T data )
        {
            return new APIResult<T> { Message = message, Code = APIEnum.Success, Data = data };
        }
        public static APIResult<T> Fail( string message)
        {
            return new APIResult<T> { Message = message, Code = APIEnum.Fail};
        }

    }
}
